/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

/**
 * @author Nguyen Tuan Vinh
 */
public class dienbienhochamClp extends BaseModelImpl<dienbienhocham>
	implements dienbienhocham {
	public dienbienhochamClp() {
	}

	public long getPrimaryKey() {
		return _madienbienhh;
	}

	public void setPrimaryKey(long pk) {
		setMadienbienhh(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_madienbienhh);
	}

	public long getMadienbienhh() {
		return _madienbienhh;
	}

	public void setMadienbienhh(long madienbienhh) {
		_madienbienhh = madienbienhh;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public String getLanguageId() {
		return _languageId;
	}

	public void setLanguageId(String languageId) {
		_languageId = languageId;
	}

	public long getMahoso() {
		return _mahoso;
	}

	public void setMahoso(long mahoso) {
		_mahoso = mahoso;
	}

	public long getMahocham() {
		return _mahocham;
	}

	public void setMahocham(long mahocham) {
		_mahocham = mahocham;
	}

	public String getChuyennganh() {
		return _chuyennganh;
	}

	public void setChuyennganh(String chuyennganh) {
		_chuyennganh = chuyennganh;
	}

	public int getNamphong() {
		return _namphong;
	}

	public void setNamphong(int namphong) {
		_namphong = namphong;
	}

	public dienbienhocham toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (dienbienhocham)Proxy.newProxyInstance(dienbienhocham.class.getClassLoader(),
				new Class[] { dienbienhocham.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		dienbienhochamClp clone = new dienbienhochamClp();

		clone.setMadienbienhh(getMadienbienhh());
		clone.setGroupId(getGroupId());
		clone.setCompanyId(getCompanyId());
		clone.setLanguageId(getLanguageId());
		clone.setMahoso(getMahoso());
		clone.setMahocham(getMahocham());
		clone.setChuyennganh(getChuyennganh());
		clone.setNamphong(getNamphong());

		return clone;
	}

	public int compareTo(dienbienhocham dienbienhocham) {
		long pk = dienbienhocham.getPrimaryKey();

		if (getPrimaryKey() < pk) {
			return -1;
		}
		else if (getPrimaryKey() > pk) {
			return 1;
		}
		else {
			return 0;
		}
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		dienbienhochamClp dienbienhocham = null;

		try {
			dienbienhocham = (dienbienhochamClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = dienbienhocham.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(17);

		sb.append("{madienbienhh=");
		sb.append(getMadienbienhh());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", languageId=");
		sb.append(getLanguageId());
		sb.append(", mahoso=");
		sb.append(getMahoso());
		sb.append(", mahocham=");
		sb.append(getMahocham());
		sb.append(", chuyennganh=");
		sb.append(getChuyennganh());
		sb.append(", namphong=");
		sb.append(getNamphong());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(28);

		sb.append("<model><model-name>");
		sb.append("doan.quanlycanbo.portlet.model.dienbienhocham");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>madienbienhh</column-name><column-value><![CDATA[");
		sb.append(getMadienbienhh());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>languageId</column-name><column-value><![CDATA[");
		sb.append(getLanguageId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mahoso</column-name><column-value><![CDATA[");
		sb.append(getMahoso());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mahocham</column-name><column-value><![CDATA[");
		sb.append(getMahocham());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>chuyennganh</column-name><column-value><![CDATA[");
		sb.append(getChuyennganh());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>namphong</column-name><column-value><![CDATA[");
		sb.append(getNamphong());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _madienbienhh;
	private long _groupId;
	private long _companyId;
	private String _languageId;
	private long _mahoso;
	private long _mahocham;
	private String _chuyennganh;
	private int _namphong;
}